package top.chengdongqing.mishop.repositories

import org.springframework.data.jpa.repository.JpaRepository
import top.chengdongqing.mishop.entities.UserFavorite

interface UserFavoriteRepository : JpaRepository<UserFavorite, Int> {

    fun findAllByUserId(userId: Int): List<UserFavorite>

    fun existsByProductIdAndUserId(productId: Int, userId: Int): Boolean

    fun countByUserId(userId: Int): Int

    fun deleteByProductIdAndUserId(productId: Int, userId: Int): Int

    fun deleteAllByUserId(userId: Int)
}